From d61f41d74af70cb14f2570e010871548f8d6056f Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Sun, 21 Aug 2005 16:48:17 +0000 Subject: [PATCH] Added HTML based documentation build --- ChangeLog | 23 + Makefile.am | 22 +- NEWS | 26 +- README.in | 129 - autogen.sh | 6 +- babl/Makefile.am | 3 +- configure.ac | 5 +- docs/.cvsignore | 5 + docs/Makefile.am | 40 + docs/babl.css | 267 + docs/graphics/.cvsignore | 1 + docs/graphics/Makefile.am | 29 + docs/graphics/babl-16x16.svg | 524 ++ docs/graphics/babl-48x48.svg | 695 +++ docs/graphics/babl-a4poster.svg | 8107 +++++++++++++++++++++++++++++++ docs/graphics/index.html | 56 + docs/index-static.html.in | 247 + docs/tools/xml_insert.sh | 23 + tests/Makefile.am | 6 +- tests/babl-html-dump.c | 137 + 20 files changed, 10206 insertions(+), 145 deletions(-) delete mode 100644 README.in create mode 100644 docs/.cvsignore create mode 100644 docs/Makefile.am create mode 100644 docs/babl.css create mode 100644 docs/graphics/.cvsignore create mode 100644 docs/graphics/Makefile.am create mode 100644 docs/graphics/babl-16x16.svg create mode 100644 docs/graphics/babl-48x48.svg create mode 100644 docs/graphics/babl-a4poster.svg create mode 100644 docs/graphics/index.html create mode 100644 docs/index-static.html.in create mode 100755 docs/tools/xml_insert.sh create mode 100644 tests/babl-html-dump.c diff --git a/ChangeLog b/ChangeLog index 70af250..5f748d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2005-08-21 Øyvind Kolås + + * Makefile.am, + * NEWS, + * autogen.sh, + * babl/Makefile.am, + * configure.ac, + * docs/.cvsignore, + * docs/Makefile.am, + * docs/babl.css, + * docs/graphics/.cvsignore, + * docs/graphics/Makefile.am, + * docs/graphics/babl-16x16.svg, + * docs/graphics/babl-48x48.svg, + * docs/graphics/babl-a4poster.svg, + * docs/graphics/index.html, + * README.in, + * docs/index-static.html.in, + * docs/tools/xml_insert.sh, + * tests/babl-html-dump.c, + * tests/Makefile.am: Added HTML based documentation as part of build + process. + 2005-08-21 Øyvind Kolås * babl/babl-classes.h: reindent, some documentation. diff --git a/Makefile.am b/Makefile.am index 22f57a3..5bbf529 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,11 +1,13 @@ AUTOMAKE_OPTIONS = foreign -SUBDIRS= babl \ - tests +SUBDIRS = babl \ + tests \ + docs DIST_SUBDIRS = babl \ - tests + tests \ + docs pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = babl.pc @@ -14,12 +16,10 @@ EXTRA_DIST = \ .cvsignore \ COPYING \ ChangeLog \ - README.in \ INSTALL.in \ NEWS \ babl.pc.in \ - autogen.sh \ - Makefile-mini + autogen.sh BUILT_EXTRA_DIST = \ README \ @@ -27,5 +27,15 @@ BUILT_EXTRA_DIST = \ .PHONY: snapshot +README: + echo "Eek!" > $@ + snapshot: $(MAKE) dist distdir=$(PACKAGE)-`date +"%Y%m%d"` +snapcheck: + $(MAKE) distcheck distdir=$(PACKAGE)-`date +"%Y%m%d"` + +distclean-local: + if test $(srcdir) = .; then :; else \ + rm -f $(BUILT_EXTRA_DIST); \ + fi diff --git a/NEWS b/NEWS index 564b4a5..f1985bc 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,27 @@ -babl-0.0.1: +
+xxxx-xx-xx babl-0.0.2 Green fish release
+ +

DRAFT

+
    +
  • Complete RGB and Grayscale models, with 2.2 gamma correction, alpha, + and premultiplied alpha. +
  • +
  • Model and component names in compact normalized form.
  • +
  • The babl mascot surfaces.
  • +
  • Website integrated into build process.
  • +
+ +
+2005-08-xx babl-0.0.1
+ +Development release of babl, minimal working configuration for RGB, CMYK and YCbCr for 8bit 16bit float and double. Emphasis is on precision and clarity of code not speed. + +
+ diff --git a/README.in b/README.in deleted file mode 100644 index eb8937b..0000000 --- a/README.in +++ /dev/null @@ -1,129 +0,0 @@ - -Babl @BABL_VERSION@ - - Dynamic, any to any, pixel format conversion library. - ------------------------------------------------------------------------ - - -General Information -=================== - -This is babl version @BABL_VERSION@, babl is a pixel format conversion -library that provides conversions to and from any formats. - -The official web site is: - http://pippin.gimp.org/babl/ - - -Installation -============ - -See the file 'INSTALL' - - -Current features -================ - -Bootstrapping with a reference conversions (to be used later for -regression tests during development of optimized versions.) - -Data types (using "double" as common translation type): - - "u8" unsigned 8bit - "u16" unsigned 16bit - "float" 32bit floating point - "double" 64bit floating point - -Color models (using "rgba" as common translation type): - - "rgb" color - "rgba" color+alpha - "rgbA" color with premultiplied alpha - "srgb" Gamma corrected "rgb" - "srgba" Gamma corrected "rgb" with linear alpha - "g" grayscale - "ga" grayscale+alpha - "gA" grayscale with premultiplied alpha - "ycbcr" Luminance and chrominances (common in video world) - "ycbcra" Luminance chromninances and alpha. - -Sampling factors: - - (1,1) Full sampling - (2,1) Half horizontal sampling - (2,1) Quartersize horizontal sampling - (1,2) Half vertical sampling - (2,2) Half resolution sampling - (4,4) Quartersize sampling - - The sampling factors can be used to implement chroma subsampling: - - YCbCr Y Cb Cr - --------+------------------- - 4:4:4 (1,1) (1,1) (1,1) - 4:2:2 (1,1) (2,1) (2,1) - 4:1:1 (1,1) (4,1) (4,1) - 4:2:0 (1,1) (2,2) (2,2) - -Pixel Formats: - - (Any format allowed by the models and types can be specified, - the following are named for easy reference.) - - "srgb" 8bit gamma corrected image with linear alpha - "srgba" used for instance for PNG files. - - "rgb_float" Floating point buffer, good choice for - "rgba_float" prototyping image processing code before - optimizing using other pixel formats. - - "lab_float" A representation useful for calculations that - "laba_float" prefers to work in a perceptually uniform color - space (note that lab is not perceptually - uniform, but closer than most others, /CIE lab/ - is used extensively in color science, and many - approaches to color difference are based in - this color model.) - - "yuv420" Video based format, often used with codecs for - instance communicating with libavcodec from the - ffmpeg project. - - "cmyk_float" A floating point cmyk buffer based directly on - "cmyka_float" linear RGB. - - cyan = (1.0-r) - min(1.0-r, 1.0-g, 1.0-b) - yellow = (1.0-r) - min(1.0-r, 1.0-g, 1.0-b) - magenta = (1.0-r) - min(1.0-r, 1.0-g, 1.0-b) - - -Introspection -============= - -Dump of babl's internal state for debugging purposes. - - -Sanity checking -=============== - -Babl will complain verbosely if any of the registered data types or -color models do not have sufficient reference conversions to be -regression tested properly. - - -Planned features -================ - -- Regression testing against double based reference implementation for - development of optimized conversions. - -- Dynamically loaded modules with additional color models, data types, - pixel formats and conversions. - -- Compile time, and maybe runtime, profiling of conversions. - -- Conversion auto builder (BablFish) capable of finding the fastest path - through the set of registered conversions to perform a specified - conversion without precision loss. - diff --git a/autogen.sh b/autogen.sh index c75f9da..d4de7b0 100755 --- a/autogen.sh +++ b/autogen.sh @@ -42,9 +42,9 @@ autoheader && \ echo "- automake." && \ automake --add-missing --gnu && \ echo && \ -./configure "$@" && \ -echo && \ -make && exit 0 +./configure "$@" && exit 0 +#echo && \ +#make && exit 0 exit 1 diff --git a/babl/Makefile.am b/babl/Makefile.am index f1a4adb..46efd33 100644 --- a/babl/Makefile.am +++ b/babl/Makefile.am @@ -63,6 +63,5 @@ libbabl_la_LDFLAGS= \ -release $(BABL_RELEASE) EXTRA_DIST := \ - .cvsignore \ - Makefile-mini + .cvsignore diff --git a/configure.ac b/configure.ac index 4f9cd7f..4b4852e 100644 --- a/configure.ac +++ b/configure.ac @@ -42,9 +42,12 @@ Makefile babl.pc babl/Makefile babl/base/Makefile +docs/Makefile +docs/index-static.html +docs/source-local.html +docs/graphics/Makefile tests/Makefile INSTALL -README ) AC_OUTPUT diff --git a/docs/.cvsignore b/docs/.cvsignore new file mode 100644 index 0000000..55fd2fb --- /dev/null +++ b/docs/.cvsignore @@ -0,0 +1,5 @@ +index.html +index-static.html +index-tmp.html +source-local.html +README diff --git a/docs/Makefile.am b/docs/Makefile.am new file mode 100644 index 0000000..d891702 --- /dev/null +++ b/docs/Makefile.am @@ -0,0 +1,40 @@ +SUBDIRS= graphics +DIST_SUBDIRS= graphics + +# The patterns used for html creation in the babl build system +# is very small, and should probably be documented in a tutorial. +# +# +# +HTML_FILES = index-static.html \ + index.html + +EXTRA_DIST= \ + .cvsignore \ + babl.css \ + tools/xml_insert.sh \ + index-static.html.in \ + index.html \ + LGPL + +BUILT_EXTRA_DIST = index.html + +CLEANFILES = README +DISTCLEANFILES = index-static.html +MAINTAINERCLEANFILES = index.html + +all: $(HTML_FILES) + +index.html: index-static.html $(top_builddir)/tests/babl_html_dump ../AUTHORS ../NEWS + cp $< $@ + $(top_builddir)/tests/babl_html_dump > /tmp/BablBase.html + $(top_srcdir)/docs/tools/xml_insert.sh $@ BablBase /tmp/BablBase.html + $(top_srcdir)/docs/tools/xml_insert.sh $@ AUTHORS $(top_srcdir)/AUTHORS + $(top_srcdir)/docs/tools/xml_insert.sh $@ NEWS $(top_srcdir)/NEWS + + w3m -cols 72 -dump $< > ../README + +distclean-local: + if test $(srcdir) = .; then :; else \ + rm -f $(BUILT_EXTRA_DIST); \ + fi diff --git a/docs/babl.css b/docs/babl.css new file mode 100644 index 0000000..0276b78 --- /dev/null +++ b/docs/babl.css @@ -0,0 +1,267 @@ + + body { + margin: 0; + padding: 0; + } + div.paper { + background-color: #fff; + margin: 1em; + margin-right: 3em; + margin-left: 280px; + } + iframe { + background-color: #aaa; + } + div.content { + padding: 1em; + padding-right: 3em; + padding-left: 2em; + max-width: 45em; + } + div.graphic { + position: absolute; + position: fixed; + color: #fff; + width: 256px; + height: 362px; + bottom: 0; + left: 0; + text-align: right; + padding-bottom: 1em; + } + p { + line-height: 1.2em; + } + h1 { + margin-top: 0em; + } + h1, h2, h3 { + color: #112266; + } + h1 { + font-size: 2em; + } + h2 { + font-size: 1.5em; + } + h3 { + font-size: 1.2em; + } + dl { + margin-top: 1em; + margin-bottom: 1em; + } + + table { + margin-top: 1em; + margin-bottom: 1em; + width: 100%; + } + table th { + font-weight: normal; + background-color: #ccc; + text-align: left; + } + span.component { + background-color: #060; + padding-left: 0.5em; + padding-top: 0.1em; + padding-bottom: 0.1em; + display: block; + float: left; + overflow: hidden; + width: 4em; + color: white; + border: 1px solid gray; + border: 1px solid white; + clear: both; + } + span.type { + display: block; + background-color: #006; + padding-left: 0.5em; + clear: both; + padding-top: 0.1em; + padding-bottom: 0.1em; + float: left; + overflow: hidden; + width: 4em; + color: white; + border: 1px solid white; + } + span.spacer { + float: left; + display: block; + overflow: hidden; + width: 0.2em; + } + span.name { + width: 100%; + display: block; + overflow: hidden; + border-top: 1px solid #ccc; + } + pre.authors { + font-size: 100%; + font-family: FreeSans, Verdana, sans-serif; + position: relative; + top: -2em; + } + img.BablFish { + float: right; + position: relative; + top: -8px; + border: none; + } + @media screen { + body { + background-color: #405070; + font-family: FreeSans, Verdana, sans-serif; + } + a { + text-decoration: none; + } + pre { + overflow: auto; + } + div.toc { + position: absolute; + position: fixed; + width: 256px; + top: 0; + left: 0; + padding-top: 2em; + z-index: 2; + } + div.toc ul { + padding-left: 0em; + float: right; + margin: 0; + } + div.toc li { + display: block; + padding-right: 1em; + } + div.toc li a{ + display: block; + padding-left: 1em; + padding-right: 1em; + color: #fff; + } + div.toc li a:hover { + color: #fff; + background-color: #506080; + } + div.paper { + max-width: 50em; + -moz-border-radius: 1em; + } + div.content { + } + div.graphic { + background: url("graphics/babl-a4poster.png"); + z-index: 1; + } + div.print { + display: none; + } + } + + @media print { + body { + background-color: none; + font-family: FreeSans, Verdana, sans-serif; + } + a, em { + /* XXX: work-around for rendering bug, should investigate whether + * this issue is fixed in the latest gecko + */ + padding-right: 3em; + padding-left: 1em; + } + a { + text-decoration: none; + } + + div.toc ul { + padding-left: 0em; + float: right; + margin: 0; + } + div.toc li { + display: block; + padding-right: 1em; + } + div.toc li a{ + display: block; + padding-left: 1em; + padding-right: 1em; + color: #fff; + } + div.toc li a:hover { + color: #fff; + background-color: #506080; + } + div.toc ul { + padding-left: 0em; + float: none; + margin: 0; + margin-left: 1em; + } + div.toc { + position: absolute; + width: 256px; + top: 0; + left: 2em; + padding-top: 2em; + z-index: 2; + } + div.toc ul { + margin-left: 0; + } + div.toc li a { + color : #000; + } + div toc h2 { + margin: 0; + padding: 0; + } + h1 { + margin-left: -0.75em; + } + h2 { + margin-left: -1em; + } + span.component { + background-color: #7f7; + color: black; + } + span.type { + background-color: #aaf; + color: black; + } + table th { + font-weight: bold; + } + div.print_title { + position: absolute; + top: 3em; + padding-left: 2em; + margin-left: 280px; + } + div.paper { + padding-top: 4em; + } + div.graphic { + background-color: #bbf; + height: 100%; + } + div.graphic img { + position: absolute; + bottom: 0; + left: 0; + } + div.screen { + display: none; + } + } diff --git a/docs/graphics/.cvsignore b/docs/graphics/.cvsignore new file mode 100644 index 0000000..e33609d --- /dev/null +++ b/docs/graphics/.cvsignore @@ -0,0 +1 @@ +*.png diff --git a/docs/graphics/Makefile.am b/docs/graphics/Makefile.am new file mode 100644 index 0000000..615eee9 --- /dev/null +++ b/docs/graphics/Makefile.am @@ -0,0 +1,29 @@ +PNG_FILES = \ + babl-a4poster.png \ + babl-16x16.png \ + babl-48x48.png + +SVG_FILES = \ + babl-a4poster.svg \ + babl-16x16.svg \ + babl-48x48.svg + +EXTRA_DIST = \ + .cvsignore \ + index.html \ + $(PNG_FILES) \ + $(SVG_FILES) + +MAINTAINERCLEANFILES = $(PNG_FILES) + +all: $(MAINTAINERCLEANFILES) + +%.png : %.svg + inkscape -e $@ $< + +# the png version of the a4 poster is used as a webgraphic +# , thus it is rendered with the background alpha set to +# 0.0 +babl-a4poster.png: babl-a4poster.svg + inkscape -e $@ $< -w 256 -y 0 + diff --git a/docs/graphics/babl-16x16.svg b/docs/graphics/babl-16x16.svg new file mode 100644 index 0000000..ea1a89d --- /dev/null +++ b/docs/graphics/babl-16x16.svg @@ -0,0 +1,524 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/graphics/babl-48x48.svg b/docs/graphics/babl-48x48.svg new file mode 100644 index 0000000..70e93a1 --- /dev/null +++ b/docs/graphics/babl-48x48.svg @@ -0,0 +1,695 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + Babl icon + 2005-08-20 + + + Øyvind Kolås + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/graphics/babl-a4poster.svg b/docs/graphics/babl-a4poster.svg new file mode 100644 index 0000000..d309b5c --- /dev/null +++ b/docs/graphics/babl-a4poster.svg @@ -0,0 +1,8107 @@ + + + + + + image/svg+xml + + + BablFish + 2005-08-20 + + + Øyvind Kolås + + + + + pippin.gimp.org + + + babl logo (as a poster) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/docs/graphics/index.html b/docs/graphics/index.html new file mode 100644 index 0000000..206470f --- /dev/null +++ b/docs/graphics/index.html @@ -0,0 +1,56 @@ + + + + + + babl graphisc + + + + + + + + + + + +
+
+ +

Babl graphics

+ +

The babl logo is a fish, the inspiration for babl itself, and it's + mascot is the original babel fish of Douglas Adams.

+ +

Icons

+ +

16x16 pixels

+ babl-16x16.png
+ Inkscape SVG source + +

48x48 pixels

+ babl-48x48.png
+ Inkscape SVG source + +

A4 poster

+ babl-a4poster.png
+ Inkscape SVG source + + +
+
+
+
+  +
+
+ + + diff --git a/docs/index-static.html.in b/docs/index-static.html.in new file mode 100644 index 0000000..b95a8b8 --- /dev/null +++ b/docs/index-static.html.in @@ -0,0 +1,247 @@ + + + + + + + + babl-@BABL_VERSION@ + + + + + + + + +
+ +
+ + + + +
+
+ +

About

+

Babl is a dynamic, any to any, pixel format conversion + library It provides conversions between the myriad of buffer + types images can be stored in. Babl doesn't only help with existing + pixel formats, but also facilitates creation of new and uncommon + ones.

+ + +

News

+ + + +

Features

+ +

Core

+
    +
  • Small polymorphic API requiring minimal manual memory management + to specify and convert between linear and planar + buffers as provided for by registered data types and color + models.
  • +
  • Horizontal an vertical subsampling (for implementing 4:2:2 4:2:0 + 4:1:1 etc. chroma subsampling)
  • +
  • Accurate (hopefully) reference data types and color models implemented using + 64bit floating point. + +
  • +
+ +

Extensions

+

+ At compile, load and runtime; babl is extendable with: +

+
    +
  • data types.
  • +
  • color models.
  • +
  • pixel formats.
  • +
  • optimized conversion functions: +
    +
    SIMD instructions
    +
    MMX, SSE, Altivec ...
    +
    External libraries +
    liboil, hermes, libavcodec, lcms, ...
  • + + +
+

+ The extension api is not going to be frozen until after the 1.0 release. +

+ + + +

Dependencies

+ +

Babl is intended to be a low level infrastructure library and thus + strives for few dependencies and thus portability.

+ + +

Core

+
    +
  • The C Standard library.
  • +
+ + +

Extensions

+
    +
  • libdl - dynamic modules. (planned)
  • +
+ + + +

Source

+ +

+ The latest development version is available in the babl module in GNOME CVS. +

+ + + +

Basic usage

+ +

The simplest scenario for using babl is converting between linear + buffers represented by an existing BablPixelFormat. +

+
+#include <babl.h>
+
+unsigned char srgb_buf[WIDTH*HEIGHT*3];
+float         lab_buf[WIDTH*HEIGHT*3];
+...
+
+babl_init (); /* initialize babl library */
+
+...
+
+Babl *babl_fish = babl_fish (babl_pixel_format ("srgb"),
+                             babl_pixel_format ("lab-float"));
+
+babl_fish_process (fish, srgb_buf, lab_buf, WIDTH * HEIGHT);
+
+...
+
+babl_destroy (); /* deinitialize babl library */
+        
+

For more code samples look in the tests directory.

+ + +

Extending

+ +

For samples of how the current internal api of specification of + data types, color models, pixel formats and their conversions look + in the babl/base/ directory. The tables in this HTML file is directly generated + based on the data registered by BablBase. +

+ +

For now, the only way to extend babl is from the application using the library, + by structuring your code in a similar fashion to BablBase it should be easier + to later turn it into a loadable module. +

+ + + +

TODO

+ +

Core

+
    +
  • Meta level optimizations.
  • +
  • Compile and/or runtime profiling. (The speed of conversions + is bound to 'wobble', according to architecture, compiler flags, + concurrently running processes and phase of moon.)
  • +
  • Subsampling support
  • +
  • Mixed BablTypes in BablPixelFormats
  • +
  • Support for datatypes that are not a multiple of 8bit.
  • + +
+ + +

Extensions

+
    +
  • Dynamic modules + babl will probably look in a colon + seperated list of paths to search sequentially for modules. + The default assumed value is +
    BABL_PATH="/usr/lib/babl/:/usr/local/lib/babl:(HOME)/.local/lib/babl:$(HOME)/lib/babl".
    +          
    + NB: the modules will be loaded from the directories pointed to by + the path in reverse order, this should allow the user to override + system wide installed types, models and pixel formats. +
  • +
+ + + + +

Copyright

+ +

Babl is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later version.

+ + +

Authors

+ +
+
Maintainer:
+
Øyvind Kolås
+
Original author:
+
Øyvind Kolås
+
Contributors:
+
          
+
+
+ + /babl-@BABL_VERSION@ +
+
+
+
+  +
+
+ + + diff --git a/docs/tools/xml_insert.sh b/docs/tools/xml_insert.sh new file mode 100755 index 0000000..5614f3a --- /dev/null +++ b/docs/tools/xml_insert.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# +# Utility script to merge an xml snippet from one file into a document. +# +# To insert the file foo.inc into bar.xml, +# after the first line containing the marker enter +# +# xml_insert.sh bar.xml foo foo.inc +# +# 2005 © Øyvind Kolås +# +# FIXME: add argument checking / error handling + +TMP_FILE=index-tmp.html + +cp $1 $TMP_FILE + +SPLIT=`grep -n "<\!--$2-->" $TMP_FILE|head -n 1|sed -e "s/:.*//"`; +head -n $SPLIT $TMP_FILE > $1 +cat $3 >> $1 +tail -n $((`wc -l $TMP_FILE | sed -e "s/ .*//"` - $SPLIT )) $TMP_FILE >> $1 + +rm $TMP_FILE diff --git a/tests/Makefile.am b/tests/Makefile.am index 6774d7d..e39b1fd 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -20,11 +20,13 @@ LDADD = $(top_builddir)/babl/libbabl.la -lm noinst_PROGRAMS = \ introspect \ + babl_html_dump \ nop \ $(TESTS) -introspect_SOURCES = introspect.c -nop_SOURCES = nop.c +introspect_SOURCES = introspect.c +babl_html_dump_SOURCES = babl-html-dump.c +nop_SOURCES = nop.c EXTRA_DIST = .cvsignore diff --git a/tests/babl-html-dump.c b/tests/babl-html-dump.c new file mode 100644 index 0000000..55a1660 --- /dev/null +++ b/tests/babl-html-dump.c @@ -0,0 +1,137 @@ +/* babl - dynamically extendable universal pixel conversion library. + * Copyright (C) 2005, Øyvind Kolås. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General + * Public License along with this library; if not, write to the + * Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307, USA. + */ + +#include "babl.h" +#include "babl-internal.h" /* for babl_log */ + +static void model_html (Babl *babl); +static void type_html (Babl *babl); +static void pixel_format_html (Babl *babl); + +static int each_item (Babl *babl, + void *user_data); + +int +main (void) +{ + babl_init (); + + + printf ("\n"); + printf ("\n"); + babl_type_each (each_item, NULL); + printf ("\n"); + printf ("\n"); + babl_model_each (each_item, NULL); + printf ("\n"); + printf ("\n"); + babl_pixel_format_each (each_item, NULL); + printf ("
Data typebitsbytes
 
Color modelcomponents
 
Pixel formatbytes/pixelcolor modelbands
\n"); + + babl_destroy (); + + return 0; +} + +static int +each_item (Babl *babl, + void *user_data) +{ + printf ("\t%s", babl->instance.name); + + switch (babl->class_type) + { + case BABL_TYPE: + type_html (babl); + break; + case BABL_MODEL: + model_html (babl); + break; + case BABL_PIXEL_FORMAT: + pixel_format_html (babl); + break; + default: + break; + } + + printf ("\n"); + return 0; +} + +static void +model_html (Babl *babl) +{ + int i; + + printf (""); + for (i=0; i< babl->model.components; i++) + { + printf ("%s 
", BABL(babl->model.component[i])->instance.name ); + } + printf (""); +} + +static void +type_html (Babl *babl) +{ + printf ("%i", babl->type.bits); + printf ("%i", babl->type.bits / 8); +} + +static void +pixel_format_html (Babl *babl) +{ + int i; + + printf (""); + { + int bytes=0; + for (i=0; i< babl->pixel_format.bands; i++) + { + bytes += BABL(babl->pixel_format.type[i])->type.bits/8; + } + printf ("%i", bytes); + } + printf (""); + printf (""); + printf ("%s", BABL(babl->pixel_format.model[0])->instance.name ); + printf (""); + printf (""); + for (i=0; i< babl->pixel_format.bands; i++) + { + printf ("%s %s 
", + BABL(babl->pixel_format.type[i])->instance.name, + BABL(babl->pixel_format.component[i])->instance.name ); + } + printf (""); +#if 0 + int i; + babl_log ("\t\tplanar=%i", babl->pixel_format.planar); + babl_log ("\t\tbands=%i", babl->pixel_format.bands); + + for (i=0; i< babl->pixel_format.bands; i++) + { + babl_log ("\t\tband[%i] type='%s' component='%s' sampling='%s'", + i, babl->pixel_format.type[i]->instance.name, + babl->pixel_format.component[i]->instance.name, + babl->pixel_format.sampling[i]->instance.name); + } +#endif +} + -- 2.30.2